Skip to content

Spend over time: by-day/by-week/by-month/by-project commands (rename :cost to :report, v1.1.0)#1

Merged
Solomonic merged 1 commit into
mainfrom
feat/spend-over-time-commands
Jun 23, 2026
Merged

Spend over time: by-day/by-week/by-month/by-project commands (rename :cost to :report, v1.1.0)#1
Solomonic merged 1 commit into
mainfrom
feat/spend-over-time-commands

Conversation

@Solomonic

Copy link
Copy Markdown
Contributor

What

Adds a command family for viewing Claude Code spend over time, and renames the single command from :cost to :report.

Command Shows
/claude-code-cost:report per project + branch, today / week / month (renamed from :cost)
/claude-code-cost:by-day spend per day, dated, most recent first (~30 days)
/claude-code-cost:by-week spend per Monday-based week, dated (~12 weeks)
/claude-code-cost:by-month spend per calendar month, dated (~12 months)
/claude-code-cost:by-project per project (branches merged) + last active date

Every command takes an optional [filter] (substring on project/branch) and --json.

Why the rename

Claude Code always namespaces plugin commands, and bare /cost is a built-in alias for /usage. The command was therefore only ever reachable as /claude-code-cost:cost, never /cost — so the landing copy that said "run /cost" was wrong. :report reads cleanly under the mandatory claude-code-cost: prefix.

How

cost.mjs now makes a single deduped, point-in-time-priced pass over the JSONL; each mode aggregates from that one event list. The by-* views read the raw logs directly (BudgetClaw's status has no per-date data); :report keeps the BudgetClaw passthrough.

Tests

node scripts/test.mjs extended to cover every new mode and the unknown-mode error path (50 checks pass). check-manifests.mjs and claude plugin validate . --strict green.

🤖 Generated with Claude Code

…o :report (v1.1.0)

Claude Code always namespaces plugin commands, and bare /cost is a built-in
alias for /usage, so this plugin's command was only ever reachable as
/claude-code-cost:cost (never /cost). Rename the command to :report so the
namespaced form reads cleanly, and add four sibling commands for spend over time:

  /claude-code-cost:report      per project + branch (today / week / month)
  /claude-code-cost:by-day      spend per day, dated, most recent first
  /claude-code-cost:by-week     spend per Monday-based week, dated
  /claude-code-cost:by-month    spend per calendar month, dated
  /claude-code-cost:by-project  per project (branches merged) + last active date

Every command takes an optional [filter] (substring on project/branch) and
--json. cost.mjs now makes a single deduped, point-in-time-priced pass over the
JSONL and each mode aggregates from that one event list. The by-* views read the
raw logs directly because `budgetclaw status` only emits the pre-rolled
today/week/month snapshot with no per-date data; :report keeps the BudgetClaw
integration. Tests extended to cover all new modes (50 checks).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Solomonic Solomonic merged commit 279fee7 into main Jun 23, 2026
3 checks passed
@Solomonic Solomonic deleted the feat/spend-over-time-commands branch June 23, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant